// TCPSocketClientDlg.h

#pragma once

#include "resource.h"
#include "TCPSocketDef.h"

class TCPSocketClient;

class TCPSocketClientDlg : public CDialogEx
{
    DECLARE_DYNAMIC(TCPSocketClientDlg)

public:
    enum
    {
        IDD = IDD_TCPSocket_Client
    };

public:
    static TCPSocketClientDlg* GetInstance(CWnd* pParent = NULL);
    static BOOL IsInitialize();

public:
    void SetCloseCallBack(CLOSE_CLIENT_DIALOG_CALLBACK callbackCloseDialog);

protected:
    TCPSocketClientDlg(CWnd* pParent = NULL);
    virtual ~TCPSocketClientDlg();
    void UnInitialize();

public:
    afx_msg void OnBnClickedOpenClient();
    afx_msg void OnBnClickedStartTransfer();
    afx_msg void OnBnClickedCloseClient();
    afx_msg void OnBnClickedCancelClient();

public:
    virtual BOOL PreTranslateMessage(MSG* pMsg);

protected:
    virtual void DoDataExchange(CDataExchange* pDX);

    DECLARE_MESSAGE_MAP()

private:
    static TCPSocketClientDlg* m_pSocketClientDlg;
    std::unique_ptr<TCPSocketClient> m_spSocketClient;
    CLOSE_CLIENT_DIALOG_CALLBACK m_callbackCloseDialog;
};
